﻿@model IEnumerable<CloudFranceTriple.WebRole.Models.TopicResult>
<section class="articlemain">
    <h3 class="title">
        @CloudFranceTriple.WebRole.Properties.Resources.ForumTopicsItemTitle
    </h3>
    <section>
        @{if ((ViewBag.ShowCreate as Boolean?) ?? false)
          {
            <p>
                @Html.ActionLink(@CloudFranceTriple.WebRole.Properties.Resources.TopicCreateButton, "Create", "Topic", new { area = "Forum" }, null)
            </p>
          }
        }
        <table>
            <thead>
                <tr>
                    <th>
                        @CloudFranceTriple.WebRole.Properties.Resources.TopicLabel
                    </th>
                    <th>
                        @CloudFranceTriple.WebRole.Properties.Resources.TopicNumberHasBeenSeen
                    </th>
                    <th>
                        @CloudFranceTriple.WebRole.Properties.Resources.TopicLastAuthor
                    </th>
                    <th>
                        @CloudFranceTriple.WebRole.Properties.Resources.TopicLastCreationDate
                    </th>
                </tr>
            </thead>
            <tbody>
                @foreach (var item in Model)
                {
                    <tr>
                        <td>
                            @Html.ActionLink(HttpUtility.HtmlDecode(item.Label), "Index", "Post", new { id = item.Id, area = "forum" }, null)
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.NumberHasBeenSeen)
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.LastPostAuthor)
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.LastPostDate)
                        </td>
                    </tr>
                }
                <tr>
                    <td colspan="4">
                        @Html.Partial("_TopicQueriesLinks")
                    </td>
                </tr>
            </tbody>
        </table>
    </section>
</section>
